import type { Application, ApplicationStatus, Project, Statistics } from '@/types'
import { MockApiService } from '@/services/mockData'

// 统一对外的 API 服务层，当前转发到 MockApiService，后续可替换为真实 HTTP 请求
export class ApiService {
  static async getUserInfo(userId: string) {
    return MockApiService.getUserInfo(userId)
  }

  static async getProjects(params?: any): Promise<{ data: Project[]; total: number }> {
    return MockApiService.getProjects(params)
  }

  static async getApplications(params?: any): Promise<{ data: Application[]; total: number }> {
    return MockApiService.getApplications(params)
  }

  static async getStatistics(): Promise<Statistics> {
    return MockApiService.getStatistics()
  }

  static async createApplication(
    application: Omit<Application, 'id' | 'createdAt' | 'updatedAt'>
  ): Promise<Application> {
    return MockApiService.createApplication(application)
  }

  static async updateApplicationStatus(
    applicationId: string,
    status: ApplicationStatus
  ): Promise<boolean> {
    return MockApiService.updateApplicationStatus(applicationId, status)
  }
}


